#pragma once
#include "AST.h"

using namespace std;

AST::AST(void){
}
AST::~AST(void){
	AST::root = NULL;
}

TreeNode* AST::createTreeNode(TreeNodeType type){
	TreeNode* node = new TreeNode(type);
	return node;
}
TreeNode* AST::createTreeNode(TreeNodeType type, int i){
	TreeNode* node = new TreeNode(type,i);
	return node;
}
void AST::setRoot(TreeNode* tNode){
	AST::root = tNode;
}
TreeNode* AST::getRoot(){
	return AST::root;
}
void AST::linkNodes(TreeNode* p,TreeNode* c){
	p->addChild(c);
	c->addParent(p);
}
void AST::linkNodesFront(TreeNode* p,TreeNode* c){
	p->addChildFront(c);
	c->addParent(p);
}
bool AST::matchesNodeType(TreeNode* node, TreeNodeType type){
	return node->getNodeType() == type;
}
int AST::getContentStoredIn(TreeNode* node){
	return node->getContent();
}